
<div class="section">
<include file="Role/header" />
    <div class="sysytem-app-main margin-left-15">
    <div class="system-app-list">
        <!-- <div class="panel panel-default"> -->
            <!-- <div class="panel-heading">
                <h3 class="panel-title"></h3>
            </div> -->
            <!-- <div class="panel-body"> -->
                <table class="table table-bordered table-hover" width="100%">
                    <thead>
                        <tr>
                            <th>角色名</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    
                    <if condition="$count">
                        <tbody>
                        <volist name="list" id="vo">
                            <tr>
                                <td><{$vo.role_name}></td>
                                <td><{$vo.created|date="Y-m-d H:i:s",###}></td>
                                <td>
                                <a href="<{:U('Role/edit?role_id='.$vo['role_id'])}>">编辑</a>
                                &nbsp;|&nbsp;
                                <a href="javascript:void(0);" class="text-danger del-role" data-url="<{:U('Role/del?role_id='.$vo['role_id'])}>">删除</a>
                                </td>

                            </tr>
                        </volist>
                            
                        </tbody>
                        <tfoot>
                        <td colspan="3" class="text-right">
                            <div class="text-right pull-right"><{$pager}></div>
                            <span class="page-number">共&nbsp;<em class="text-primary"><{$count}></em>&nbsp;条记录</span>
                            
                        </td>
                        </tfoot>
                        <else />
                        <tr>
                        <td colspan="3">还没有数据</td>
                        </tr>
                        </if>
                </table>
            <!-- </div> -->
        <!-- </div> -->
        </div>
    </div>
</div>

<!-- 弹窗提示 -->
<div class="modal fade" id="del-role" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
  <div class="modal-dialog" role="document" aria-hidden="true">
  <div class="modal-content">
    <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="gridSystemModalLabel">删除角色</h4>
    </div>
    <div class="modal-body">
        <div class="alert alert-danger" role="alert">您确定要删除这个角色吗？</div>
        <div class="alert alert-info" role="alert">提示：删除后，和此角色关联的账号将会被禁用，需要重新对账号设置角色才可以继续使用账号。</div>
        
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" id="del-role-sure">确定</button>
    </div>
  </div>
</div>
</div>
<script>
    // 删除角色
    var delRole = $('.del-role');
    delRole.each(function(){
    	var $this=$(this);
    	$this.on('click',function(){
    		$('#del-role').modal('show');
    		$('#del-role-sure').on('click',function(){
                $('#del-cat').modal('hide');
                var delUrl = $this.attr('data-url');
                window.location.href = delUrl;
            })
    	})
    })
</script>